<template>
  <div >
    <a-form-model class="fromModels" ref="plannedModel"  :model="plannedFroms" layout="vertical" 
    :labelCol="{span: 6}" :wrapperCol="{span: 12}">
        <a-form-model-item label="是否启用" >
          <a-radio-group v-model="plannedFroms.enable">
            <a-radio :value="1"> 是 </a-radio>
            <a-radio :value="0"> 否 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item label="使用最高等级费率" >
          <a-radio-group v-model="plannedFroms.use_level_rate">
            <a-radio :value="1"> 是 </a-radio>
            <a-radio :value="0"> 否 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item label="自动切换通道" >
          <a-radio-group v-model="plannedFroms.auto_change">
            <a-radio :value="1"> 是 </a-radio>
            <a-radio :value="0"> 否 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item  :wrapper-col="{ span: 12, offset:5 }">
          <a-button type="primary" @click="whites">提交</a-button>
        </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
import {getConfigCommon,writeConfigCommon } from '@/api/system.js'
export default {
  name: 'planned',
  
  data() {
      return {
        plannedFroms:{
          auto_change:1,
          enable:1,
          use_level_rate:1,
        },
      }
  },
  created(){
    this.getPrivacyAgreementInfo()
  },
  methods:{
    getPrivacyAgreementInfo(){
      getConfigCommon({
        brand_id: process.env.VUE_APP_BRAND_ID,
        scene:'repayment_channel_sort',
      }).then(res=>{
        this.plannedFroms=res.data
      })
    },
    whites(){
      writeConfigCommon({
        brand_id: process.env.VUE_APP_BRAND_ID,
        scene:'repayment_channel_sort',
        ...this.plannedFroms
      }).then(res=>{
        this.$message.success("操作成功");
      })
    },
  }
}
</script>

<style lang="less" scoped>
</style>
